package com.leonne.harpacristabrasileira.lists.adapters;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.leonne.harpacristabrasileira.tools.DrawableManager;

public class GenericAdapter  extends BaseAdapter {

    private Activity activity;
    private ArrayList<?> objects;
    public LayoutInflater inflater=null;
    private DrawableManager drawableManager;
    private int selectedPos = -1;
    
	public GenericAdapter(Activity activity, ArrayList<?> objects) {
		this.setActivity(activity);
        this.setObjects(objects);
        this.setInflater((LayoutInflater) this.getActivity().getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE));
        this.setDrawableManager(new DrawableManager());
	}
    
	public Activity getActivity() {
		return activity;
	}

	public void setActivity(Activity activity) {
		this.activity = activity;
	}

	public ArrayList<?> getObjects() {
		return objects;
	}

	public void setObjects(ArrayList<?> objects) {
		this.objects = objects;
	}

	public LayoutInflater getInflater() {
		return inflater;
	}

	public void setInflater(LayoutInflater inflater) {
		this.inflater = inflater;
	}

	public DrawableManager getDrawableManager() {
		return drawableManager;
	}

	public void setDrawableManager(DrawableManager drawableManager) {
		this.drawableManager = drawableManager;
	}

	public int getSelectedPos() {
		return selectedPos;
	}

	public void setSelectedPos(int selectedPos) {
		this.selectedPos = selectedPos;
		notifyDataSetChanged();
	}
	
	public int getCount() {
		return this.getObjects().size();
	}

	public Object getItem(int position) {
		return position;
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int arg0, View arg1, ViewGroup arg2) {
		return null;
	}

}
